import request from '@/config/axios'

export interface MaterialVideoVO {
  id: number
  materialUrl: string
  coverUrl: string
  width: number
  height: number
  userId: number
}

// 查询视频分页
export const getMaterialVideoPage = async (params) => {
  return await request.get({ url: `/operate/material-video/page`, params })
}

// 查询视频详情
export const getMaterialVideo = async (id: number) => {
  return await request.get({ url: `/operate/material-video/get?id=` + id })
}

// 新增视频
export const createMaterialVideo = async (data: MaterialVideoVO) => {
  return await request.post({ url: `/operate/material-video/create`, data })
}

// 修改视频
export const updateMaterialVideo = async (data: MaterialVideoVO) => {
  return await request.put({ url: `/operate/material-video/update`, data })
}

// 删除视频
export const deleteMaterialVideo = async (id: number) => {
  return await request.delete({ url: `/operate/material-video/delete?id=` + id })
}

// 导出视频 Excel
export const exportMaterialVideo = async (params) => {
  return await request.download({ url: `/operate/material-video/export-excel`, params })
}